package com.design.pattern.decorator;

/**
 * @Description 装饰者模式：已有的功能上动态的增加更多的功能
 * 搭配衣服为例
 * @author ll
 * @createTime 2021/6/1  16:33 
 */
public class Main {
	public static void main(String[] args) {
		//测试C->B->B样式给张三搭配服装
		Person person = new Person("张三");

		//声明具体的装饰类
		DecoratorA decoratorA = new DecoratorA();
		DecoratorB decoratorB = new DecoratorB();
		DecoratorC decoratorC = new DecoratorC();

		decoratorA.decorator(person);
		decoratorB.decorator(decoratorA);
		decoratorC.decorator(decoratorB);
		decoratorC.show();

	}
}
